<%--
  Created by IntelliJ IDEA.
  User: 李景辉
  Date: 2017/12/7
  Time: 11:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <script src="<%=request.getContextPath()%>/js/jquery.js"></script>
    <script src="<%=request.getContextPath()%>/js/jquery.validate.min.js"></script>
    <script src="<%=request.getContextPath()%>/js/messages_zh.js"></script>
    <script>
        function myFunction(){
            $.ajax({
                 type:"post",
                 url:"testjson",
                 data:{
                     id:1
                 },
                dataType:'json',
                success : function(data){
                    alert(data);
                }
            });
        };
    </script>
<body>
<input type="button" value="获取" onclick="myFunction()"/>
<br>
<table id="myTable">
    <thead>
    <tr>
        <td>商品名</td>
        <td>价格</td>
    </tr>
    </thead>
     <tbody>
    </tbody>
</table>
</body>
</html>
